function empty(){};
function empty_2(){return {}};
function start(){
	this.bindEvent();
	this.createDom();
}
function init(options) {
	options = options || {};
	this.el=options.el||'body';
	this.created=options.created||empty;
	this.mounted=options.mounted||empty;
	this.methods=options.methods||{};
	if(typeof options.data=='function'){
		options.data=options.data();
	}
	this.data=options.data||empty_2;
	this.extend(options.data);
	this.createDom();
	start.call(this);
//	options.created && options.created();
//	options.mounted && options.mounted();
};

var components={};
init.component=function(){
	return function(options){
		options=options||{};
	}
}()
init.prototype.extend = $.extend;
init.prototype.bindEvent = function(){
	var time,omethod;
	return function(options) {
		var that=this;
		$(this.el).on('click', '*[click]', function(e) {
			var otime=window.event.timeStamp;
			if(time&&(otime-time)<500&&((otime-time)!=0)){
				return;
			}
			time=otime;
			var a = $(this).attr('click'),
				g, f;
			var b = a.replace(/\(.*\)/, function(str) {
				g = str.replace('(', '').replace(')', '').split(',') || [];
				return '';
			})
			g && g.unshift(e);
			that.methods && that.methods[b] && that.methods[b].apply(this, g && g);
		})
	}
}()
init.prototype.createDom = function() {
}
init.prototype.liactive = function() {
	$('.navbox').find('li').removeClass('active');
	$('.navbox').eq(i).find('li').eq(index).addClass('active');
}

$(function(){
	$('.navbox').find('li.active').parent('.navbox').siblings('.title').find('span.glyphicon').removeClass('glyphicon-menu-right').addClass('glyphicon-menu-down')
	$('.navbox').find('li.active').parent('.navbox').addClass('active');
})
module.exports=init;